package com.lucy.viewer.utils;

import cn.hutool.cache.Cache;
import cn.hutool.cache.CacheUtil;
import cn.hutool.cache.impl.LFUCache;
import com.lucy.viewer.params.ViewerFile;
import lombok.extern.slf4j.Slf4j;

/**
 * @author kindear
 * lucy-viewer 缓存工具
 * FIFO 先进先出
 */
@Slf4j
public class ViewerFileCache {
    // 本地缓存的文件
    public static final Cache<String,ViewerFile> files = CacheUtil.newFIFOCache(20);

    public static void put(String key,ViewerFile value){
        files.put(key,value);
    }

    public static ViewerFile get(String key){
        return files.get(key);
    }
}
